\(\int x^3 \cot (a+i \log (x)) \, dx\) [186]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 49 \[ \int x^3 \cot (a+i \log (x)) \, dx=-i e^{2 i a} x^2-\frac {i x^4}{4}-i e^{4 i a} \log \left (e^{2 i a}-x^2\right ) \]

[Out]

-I*exp(2*I*a)*x^2-1/4*I*x^4-I*exp(4*I*a)*ln(exp(2*I*a)-x^2)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {4592, 456, 457, 78} \[ \int x^3 \cot (a+i \log (x)) \, dx=-i e^{2 i a} x^2-i e^{4 i a} \log \left (-x^2+e^{2 i a}\right )-\frac {i x^4}{4} \]

[In]

Int[x^3*Cot[a + I*Log[x]],x]

[Out]

(-I)*E^((2*I)*a)*x^2 - (I/4)*x^4 - I*E^((4*I)*a)*Log[E^((2*I)*a) - x^2]

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 456

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[x^(m + n*(p + q
))*(b + a/x^n)^p*(d + c/x^n)^q, x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[p, q] &&
NegQ[n]

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 4592

Int[Cot[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*((-I - I*E^(2*I*a*d)
*x^(2*I*b*d))/(1 - E^(2*I*a*d)*x^(2*I*b*d)))^p, x] /; FreeQ[{a, b, d, e, m, p}, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\left (-i-\frac {i e^{2 i a}}{x^2}\right ) x^3}{1-\frac {e^{2 i a}}{x^2}} \, dx \\ & = \int \frac {x^3 \left (-i e^{2 i a}-i x^2\right )}{-e^{2 i a}+x^2} \, dx \\ & = \frac {1}{2} \text {Subst}\left (\int \frac {\left (-i e^{2 i a}-i x\right ) x}{-e^{2 i a}+x} \, dx,x,x^2\right ) \\ & = \frac {1}{2} \text {Subst}\left (\int \left (-2 i e^{2 i a}+\frac {2 i e^{4 i a}}{e^{2 i a}-x}-i x\right ) \, dx,x,x^2\right ) \\ & = -i e^{2 i a} x^2-\frac {i x^4}{4}-i e^{4 i a} \log \left (e^{2 i a}-x^2\right ) \\ \end{align*}

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(137\) vs. \(2(49)=98\).

Time = 0.09 (sec) , antiderivative size = 137, normalized size of antiderivative = 2.80 \[ \int x^3 \cot (a+i \log (x)) \, dx=-\frac {i x^4}{4}-i x^2 \cos (2 a)-\arctan \left (\frac {\left (-1+x^2\right ) \cos (a)}{-\sin (a)-x^2 \sin (a)}\right ) \cos (4 a)-\frac {1}{2} i \cos (4 a) \log \left (1+x^4-2 x^2 \cos (2 a)\right )+x^2 \sin (2 a)-i \arctan \left (\frac {\left (-1+x^2\right ) \cos (a)}{-\sin (a)-x^2 \sin (a)}\right ) \sin (4 a)+\frac {1}{2} \log \left (1+x^4-2 x^2 \cos (2 a)\right ) \sin (4 a) \]

[In]

Integrate[x^3*Cot[a + I*Log[x]],x]

[Out]

(-1/4*I)*x^4 - I*x^2*Cos[2*a] - ArcTan[((-1 + x^2)*Cos[a])/(-Sin[a] - x^2*Sin[a])]*Cos[4*a] - (I/2)*Cos[4*a]*L
og[1 + x^4 - 2*x^2*Cos[2*a]] + x^2*Sin[2*a] - I*ArcTan[((-1 + x^2)*Cos[a])/(-Sin[a] - x^2*Sin[a])]*Sin[4*a] +
(Log[1 + x^4 - 2*x^2*Cos[2*a]]*Sin[4*a])/2

Maple [A] (verified)

Time = 0.48 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.80

method result size
risch \(-i {\mathrm e}^{2 i a} x^{2}-\frac {i x^{4}}{4}-i {\mathrm e}^{4 i a} \ln \left ({\mathrm e}^{2 i a}-x^{2}\right )\) \(39\)

[In]

int(x^3*cot(a+I*ln(x)),x,method=_RETURNVERBOSE)

[Out]

-I*exp(2*I*a)*x^2-1/4*I*x^4-I*exp(4*I*a)*ln(exp(2*I*a)-x^2)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.65 \[ \int x^3 \cot (a+i \log (x)) \, dx=-\frac {1}{4} i \, x^{4} - i \, x^{2} e^{\left (2 i \, a\right )} - i \, e^{\left (4 i \, a\right )} \log \left (x^{2} - e^{\left (2 i \, a\right )}\right ) \]

[In]

integrate(x^3*cot(a+I*log(x)),x, algorithm="fricas")

[Out]

-1/4*I*x^4 - I*x^2*e^(2*I*a) - I*e^(4*I*a)*log(x^2 - e^(2*I*a))

Sympy [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.80 \[ \int x^3 \cot (a+i \log (x)) \, dx=- \frac {i x^{4}}{4} - i x^{2} e^{2 i a} - i e^{4 i a} \log {\left (x^{2} - e^{2 i a} \right )} \]

[In]

integrate(x**3*cot(a+I*ln(x)),x)

[Out]

-I*x**4/4 - I*x**2*exp(2*I*a) - I*exp(4*I*a)*log(x**2 - exp(2*I*a))

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 131 vs. \(2 (32) = 64\).

Time = 0.23 (sec) , antiderivative size = 131, normalized size of antiderivative = 2.67 \[ \int x^3 \cot (a+i \log (x)) \, dx=-\frac {1}{4} i \, x^{4} - x^{2} {\left (i \, \cos \left (2 \, a\right ) - \sin \left (2 \, a\right )\right )} + {\left (\cos \left (4 \, a\right ) + i \, \sin \left (4 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) - {\left (\cos \left (4 \, a\right ) + i \, \sin \left (4 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right ) - \frac {1}{2} \, {\left (i \, \cos \left (4 \, a\right ) - \sin \left (4 \, a\right )\right )} \log \left (x^{2} + 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) - \frac {1}{2} \, {\left (i \, \cos \left (4 \, a\right ) - \sin \left (4 \, a\right )\right )} \log \left (x^{2} - 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) \]

[In]

integrate(x^3*cot(a+I*log(x)),x, algorithm="maxima")

[Out]

-1/4*I*x^4 - x^2*(I*cos(2*a) - sin(2*a)) + (cos(4*a) + I*sin(4*a))*arctan2(sin(a), x + cos(a)) - (cos(4*a) + I
*sin(4*a))*arctan2(sin(a), x - cos(a)) - 1/2*(I*cos(4*a) - sin(4*a))*log(x^2 + 2*x*cos(a) + cos(a)^2 + sin(a)^
2) - 1/2*(I*cos(4*a) - sin(4*a))*log(x^2 - 2*x*cos(a) + cos(a)^2 + sin(a)^2)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.02 \[ \int x^3 \cot (a+i \log (x)) \, dx=-\frac {1}{4} i \, x^{4} - i \, x^{2} e^{\left (2 i \, a\right )} + \frac {1}{2} \, \pi e^{\left (4 i \, a\right )} - i \, e^{\left (4 i \, a\right )} \log \left (x + e^{\left (i \, a\right )}\right ) - i \, e^{\left (4 i \, a\right )} \log \left (-x + e^{\left (i \, a\right )}\right ) \]

[In]

integrate(x^3*cot(a+I*log(x)),x, algorithm="giac")

[Out]

-1/4*I*x^4 - I*x^2*e^(2*I*a) + 1/2*pi*e^(4*I*a) - I*e^(4*I*a)*log(x + e^(I*a)) - I*e^(4*I*a)*log(-x + e^(I*a))

Mupad [B] (verification not implemented)

Time = 28.44 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.78 \[ \int x^3 \cot (a+i \log (x)) \, dx=-x^2\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,1{}\mathrm {i}-\ln \left (x^2-{\mathrm {e}}^{a\,2{}\mathrm {i}}\right )\,{\mathrm {e}}^{a\,4{}\mathrm {i}}\,1{}\mathrm {i}-\frac {x^4\,1{}\mathrm {i}}{4} \]

[In]

int(x^3*cot(a + log(x)*1i),x)

[Out]

- x^2*exp(a*2i)*1i - log(x^2 - exp(a*2i))*exp(a*4i)*1i - (x^4*1i)/4